<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

</head>
<body>
<div class="table-responsive">
    <table class="table  table-bordered">
        <thead>
        <tr >
            <th width="30">#</th>
            <th width="30"><input id="summaryBox"  type="checkbox"></th>
        </tr>
        </thead>
        <tbody>


        <tr >
            <td class="1"><input type="checkbox" class="itemBox" >1</td>
            <br>
            <td class="1"><input type="checkbox" class="itemBox" >2</td>
            <br>
            <td class="1"><input type="checkbox" class="itemBox" >3</td>
            <br>
            <td class="1"><input type="checkbox" class="itemBox" >4</td>
            <br>
            <td class="1"><input type="checkbox" class="itemBox" >5</td>
            <br>
            <td>
                <button type="button" class="btn btn-success btn-xs"><i class=" glyphicon glyphicon-check"></i></button>
                <button type="button" class="btn btn-primary btn-xs"><i class=" glyphicon glyphicon-pencil"></i></button>
                <button type="button" class="btn btn-danger btn-xs uniqueRemoveBtn"><i class=" glyphicon glyphicon-remove"></i></button>
            </td>
        </tr>
        </tbody>

    </table>
    <button type="button" id="batchRemoveBtn"  class="btn btn-danger" style="float:right;margin-left:10px;"><i class=" glyphicon glyphicon-remove"></i> 删除</button>
</div>
</body>
</html>
<script type="text/javascript">
    // 对分页导航条显示进行初始化
    $("#summaryBox").click(function() {
        // 获取当前#summaryBox的勾选状态
        // this代表当前多选框对象（DOM对象）
        // checked属性为true时表示被勾选，为false时表示没有被勾选
        // 使用checkStatus设置.itemBox的状态
        $(".itemBox").prop("checked",this.checked);
    });
    $("#batchRemoveBtn").click(function () {
        // 创建数组对象：存储adminId
        var adminIdArray = new Array();
        // 创建数组对象：存储loginAcct
        var loginAcctArray = new Array();
        $(".itemBox:checked").each(function () {
            var adminId = $(this).attr("1");
            adminIdArray.push(adminId);
            var loginAcct = $(this).parent("td").next().text();
            loginAcctArray.push(loginAcct);
        });
        if (adminIdArray.length == 0) {
            alert("请勾选您要删除的记录！");
            return;
        }
        var confirmResult = confirm("您真的要删除" + loginAcctArray + "信息吗？操作不可逆，请谨慎决定！");
        if (confirmResult == false) {
            return;
        }
    });
</script>